const mongoose = require('mongoose')
const menuSchema = mongoose.Schema({
    menuType: Number,   //菜单类型 1：菜单 2：按钮
    menuName: String,   //菜单名称
    menuCode: String,   //权限标识
    path: String,   //路由地址
    icon: String,   //图标
    component: String,   //组件路径
    menuState: Number,   //菜单状态 1：正常 2：禁用
    parentId: [mongoose.Types.ObjectId],   //父级ID
    "createTime" : {
        type: Date,
        default: Date.now()
    },//创建时间
    "updateTime" : {
        type: Date,
        default: Date.now()
    },//更新时间
})

module.exports = mongoose.model("menu", menuSchema, "menus")//第三个参数是集合名称